﻿#include <QtTest>
#include <QCoreApplication>

// add necessary includes here
#include "ZMultiThread/ZMultiThreadCtrl.h"
#include "TestTask.h"

class ZTaskThreadTest : public QObject
{
    Q_OBJECT

public:
    ZTaskThreadTest();
    ~ZTaskThreadTest();

private slots:
    void initTestCase();
    void cleanupTestCase();
    void test_case1();

};

ZTaskThreadTest::ZTaskThreadTest()
{

}

ZTaskThreadTest::~ZTaskThreadTest()
{

}

void ZTaskThreadTest::initTestCase()
{

}

void ZTaskThreadTest::cleanupTestCase()
{

}

void ZTaskThreadTest::test_case1()
{
    // 开启多线程任务
    ZMultiThreadCtrl ctrl;
    ctrl.addTask(QSharedPointer<ZMultiThreadTask>(new TestTask));

    // 开启事件循环
    qApp->exec();
}

QTEST_MAIN(ZTaskThreadTest)

#include "tst_zmultithreadtest.moc"
